package com.tiheima.config;

import com.tiheima.utils.MinIOUtils;
import lombok.Getter;
import lombok.Setter;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.stereotype.Component;

@Setter
@Getter
// @Configuration
@Component
@ConfigurationProperties(prefix = "minio")
public class MinIOConfig {

    private String endpoint;
    private String fileHost;
    private String bucketName;
    private String accessKey;
    private String secretKey;

    @Bean
    public MinIOUtils creatMinioClient() {
        return new MinIOUtils(endpoint, fileHost, bucketName, accessKey, secretKey);
    }

}
